package com.yztc.yidoutang.activity.daren_activity;

import com.yztc.yidoutang.bean.DaRenBean;
import com.yztc.yidoutang.bean.DaRenListBean;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by My on 2016/10/19.
 */

public class DaRenPresenter implements DaRenContract.Presenter {
    private DaRenContract.Model model;
    private DaRenContract.View view;
    private Map<String,String> map;

    public DaRenPresenter(DaRenContract.View view) {
        this.view = view;
        this.model=new DaRenModel();
    }

    @Override
    public void getDataForNet() {
        map=new HashMap<>();
        //recommend_tag=1&page=1&last_tid=0&banner=1
        map.put("recommend_tag","1");
        map.put("page","1");
        map.put("last_tid","0");
        map.put("banner","1");
        model.getDaRenData(map, new DaRenContract.OnLoadDaRenListener() {
            @Override
            public void onSuccess(DaRenBean daRenBean) {
                List<DaRenListBean> list=daRenBean.getData().getGuides();
                view.onDaRenSuccess(list);
            }

            @Override
            public void onFail(Exception e) {

            }
        });
    }
}
